<template>
	<div class="sw_setting_frame">
		<h2 v-if="!!title">{{ title }}</h2>
		<div class="form" v-if="!!$slots.form">
			<slot name="form"></slot>
		</div>
		<div class="tips" v-if="!!tips">{{ tips }}</div>
		<div class="body" v-if="!!$slots.body">
			<slot name="body"></slot>
		</div>
	</div>
</template>

<script>
export default {
	name: 'swSettingFrame',
	props: {
		tips: { type: String, default: '' },
		title: { type: String, default: '' }
	}
};
</script>

<style lang="scss" scoped>
.sw_setting_frame {
	padding: 16px;
	h2 {
		line-height: 1;
		font-size: 18px;
		margin-bottom: 16px;
	}
	.form {
		display: flex;
		align-items: center;
		line-height: 1;
	}
	&:deep(.el-switch) {
		margin-left: 10px;
	}
	.tips {
		color: #909399;
		margin-top: 12px;
	}
	.body {
		display: flex;
		flex-wrap: wrap;
		padding-top: 2px;
		span,
		font {
			margin-top: 10px;
			line-height: 28px;
		}
		font {
			margin-left: 8px;
		}
		span {
			margin-right: 8px;
		}
	}
	.el-button {
		margin: 10px 0 0 10px;
	}
	.el-input {
		width: 48px;
		margin-top: 10px;
	}
	&:deep(.el-input__inner) {
		padding: 0;
		font-size: 14px;
		text-align: center;
	}
}
</style>
